/*****************************************************************************
 *   uart.h:  Header file for NXP LPC23xx Family Microprocessors
 *
 *   Copyright(C) 2006, NXP Semiconductor
 *   All rights reserved.
 *
 *   History
 *   2006.09.01  ver 1.00    Prelimnary version, first Release
 *
******************************************************************************/
#ifndef __UART_H 
#define __UART_H
#ifdef __cplusplus
extern "C" {
#endif
#define IER_RBR   0x01
#define IER_THRE  0x02
#define IER_RLS   0x04

#define IIR_PEND  0x01
#define IIR_RLS   0x03
#define IIR_RDA   0x02
#define IIR_CTI   0x06
#define IIR_THRE  0x01

#define LSR_RDR   0x01
#define LSR_OE    0x02
#define LSR_PE    0x04
#define LSR_FE    0x08
#define LSR_BI    0x10
#define LSR_THRE  0x20
#define LSR_TEMT  0x40
#define LSR_RXFE  0x80

#define BUFSIZE   0x10

void UART_C(char *bf);
//DWORD UARTInit( DWORD Baudrate );
DWORD UARTInit( DWORD UART_SELECT,DWORD baudrate  );
__irq __nested __arm void UART0Handler( void );
__irq /*__nested*/ __arm void UART0_Handler(void);//6
__irq /*__nested*/ __arm void UART3_Handler(void);//6
 void UART_STATUS(char *buf1,char *buf2);
void INTtoCHAR(unsigned int TestUART);
void UARTSend( BYTE *BufferPtr, DWORD Length );
void UARTWelcome(void);
void UARTCW(void);
void UART_CLEAR(void);
void CONFIG_CONTROLL(void);
void CONFIG_RX_DATE(signed char CONFChar);
int GET_AI(int AI_NUM);

extern void CharToHexTime(unsigned char x[4])	;
int SET_UPXR();
void UART_RX_DATE(signed char XChar);
void UART_resend_DATE(char* UARTZXBufferS,int lens,int GSM_SEL);
int UART_CONTROLL(char* desta);
int UART_FIND_COMM(char* destb);
int UART_READ(char* dest, int length,char* respx,int timeoutx);
void DATA_SEND(unsigned int TestUART,unsigned int AINF);

#ifdef __cplusplus
}
#endif
#endif /* end __UART_H */
/*****************************************************************************
**                            End Of File
******************************************************************************/
